Use Your Machine Name (Not Just localhost) with HTTPS on ASP.NET Core — and Make Node.js Trust It
When you run dotnet dev-certs https --trust, .NET creates and trusts a localhost-only developer certificate. That’s great for https://localhost:1234, but it won’t cover https://my-machine:1234.
If you want to reach your service by machine name (e.g., https://my-machine:7164) you need to create your own self-signed certificate that lists all the names you’ll use (machine name, localhost, and optionally 127.0.0.1) and then configure Kestrel to use it. You’ll also need to trust that certificate for browsers — and tell Node.js how to trust it.
Below are clean, copy-pasteable steps for Windows/PowerShell.
# Names you want this cert to cover (add/remove as needed)
$dns = @("my-machine", "localhost", "127.0.0.1")
# Create a leaf certificate in CurrentUser\My
$cert = New-SelfSignedCertificate -Dn…
( 8
min )